<?php
class Obj_System_MetaPlugin extends Zend_Controller_Plugin_Abstract
{
	
    public function postDispatch(Zend_Controller_Request_Abstract $request)
    {
    	if (Zend_Registry::isRegistered('metainfo')) {
    		$arInfo = Zend_Registry::get('metainfo');
    		$arDInfo = Zend_Registry::get('dmetainfo');
    		
			$layout = Zend_Layout::getMvcInstance();
			$view = $layout->getView();
			if ($arInfo['title'] != '') $arInfo['title'] .= ' | '; 
			$view->headTitle($arInfo['title']._('Продажа, аренда недвижимости Турции, Италии, России | Агентство недвижимости Аврора Инвестмент'));
			$view->headMeta(trim($arInfo['description']) != '' ? $arInfo['description'] : $arDInfo['description'], 'description');
			$view->headMeta(trim($arInfo['keywords']) != '' ? $arInfo['keywords'] : $arDInfo['keywords'], 'keywords');
			//gmdate('D, d M Y H:i:s', $date) . ' GMT';
    	}
    }
}
